Skip to content

Add workspaces - #68

Merged
adampoit merged 3 commits into
mainfrom
workspaces
Aug 6, 2026
Merged

Add workspaces#68
adampoit merged 3 commits into
mainfrom
workspaces

Conversation

@adampoit

@adampoit adampoit commented Aug 5, 2026

Copy link
Copy Markdown
Owner

No description provided.

@not-adam

not-adam Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Mira PR Walkthrough

This PR adds the ability to specify a target lane override when landing a workspace, via a new --lane CLI flag and lane option on landWorkspace(). It also persists the landed lane name (landedLane) in workspace state, adds a comprehensive integration test suite with three fixture types (basic, conflict, overlap), and includes a minor line cleanup in workspace-land.ts.

graph LR
    cli["src/cli.ts"]
    land["src/workspace-land.ts"]
    state["src/workspace-state.ts"]
    test["tests/workspace.test.ts"]

    cli -- "--lane flag" --> land
    land -- "writes landedLane" --> state
    test -- "exercises" --> land
    test -- "verifies" --> state
Loading
Confidence: 4/5   ◉◉◉◉○   Safe with minor fixes
  • Core logic changes are well-scoped and tested, but the landedLane state field is set but not validated in the round-trip test beyond the basic fixture. No issues with the approach otherwise.

Blast Radius — 2 dependent repositories, 3 total references

adampoit/mira — 1 reference
adampoit/wezterm — 2 references

3 files reviewed


Comment @not-adam help to get the list of available commands and usage tips.

@not-adam not-adam Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mira Review Summary

This is a large, well-structured PR implementing composed workspaces for Patchlane 0.5.3. The architecture is sound: separating composition from sync, pinning lane SHAs at workspace creation time, and enforcing exact tree equality via round-trip validation. Two issues need attention before merge: (1) the CLI workspace land handler does not propagate --origin-remote-name, --upstream-remote-name, or UPSTREAM_REMOTE_URL options to landWorkspace(), making those CLI flags silently ignored; (2) no tests were added alongside the ~1,700 lines of new source code — the workspace creation, landing (including projection, recomposition, and exact tree comparison), state persistence, and cleanup paths all need coverage.

Key Issues

Issue Location
🔴 CLI options --origin-remote-name, --upstream-remote-name, and UPSTREAM_REMOTE_URL are not propagated from the CLI workspace command handler to landWorkspace(), making the advertised CLI flags silently ineffective for the land action. src/cli.ts:170
🔴 No tests added for ~1,700 lines of new workspace logic including commit replay, exact tree comparison, atomic state persistence, and cleanup error paths. src/workspace-create.ts:118

Comment thread src/workspace-create.ts
Comment thread src/cli.ts

@not-adam not-adam Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mira Review Summary

One issue found: the local lane branch is updated to candidateLaneSha before the push attempt when --push is used. If the push fails, the local branch has already been mutated while the workspace state remains unlanded, creating an inconsistent state. The local ref update should move after a successful push, or at minimum be rolled back on push failure.

Key Issues

Issue Location
🔴 Local lane branch refs/heads/${targetLane} is updated unconditionally at line 403 before the push block. If the push fails, the local branch has already been mutated to candidateLaneSha with no corresponding workspace state update, leaving the system in an inconsistent state. src/workspace-land.ts:403

Comment thread src/workspace-land.ts Outdated
@adampoit
adampoit merged commit 0cd31ce into main Aug 6, 2026
2 checks passed
@adampoit
adampoit deleted the workspaces branch August 6, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant